//封装高阶组件
//核心逻辑，有Token 正常跳转,无Token去跳转
import {Navigate} from "react-router-dom"
import { getToken } from "@/utils";
function AuthRouer({children}){
    const token=getToken()
    if(token){
        return <>{children}</>
    }else{
     return <Navigate to={"/login"} replace></Navigate>
    }
}

export default AuthRouer